home *** CD-ROM | disk | FTP | other *** search
/ Java Internet Programming Reference Guide / Java Internet Programming Reference Guide.iso / autorun / java.dir / 00130_12d.txt < prev    next >
Encoding:
Text File  |  1996-01-12  |  9.1 KB  |  995 lines

  1.  
  2. log method
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10. Returns the natural logarithm (base e) of its argument.
  11.  
  12.  
  13.  
  14.  
  15.  
  16. Syntax
  17.  
  18.  
  19.  
  20.  
  21. log(arg)
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. Applies to
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. Math
  36.  
  37.  
  38.  
  39.  
  40.  
  41. Examples
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. xxx Examples to be supplied.
  49.  
  50.  
  51.  
  52.  
  53.  
  54. See also
  55.  
  56.  
  57.  
  58.  
  59. exp method
  60.  
  61.  
  62. ------------------------------------------------------------------------
  63.  
  64.  
  65.  
  66.  
  67.  
  68. max method
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76. Returns the greater of its two arguments.
  77.  
  78.  
  79.  
  80.  
  81.  
  82. Syntax
  83.  
  84.  
  85.  
  86.  
  87. max(arg1, arg2)
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94. Applies to
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. Math
  102.  
  103.  
  104.  
  105.  
  106.  
  107. Examples
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. xxx Examples to be supplied.
  115.  
  116.  
  117.  
  118.  
  119.  
  120. See also
  121.  
  122.  
  123.  
  124.  
  125. min method
  126.  
  127.  
  128. ------------------------------------------------------------------------
  129.  
  130.  
  131.  
  132.  
  133.  
  134. min method
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142. Returns the lesser of its two arguments.
  143.  
  144.  
  145.  
  146.  
  147.  
  148. Syntax
  149.  
  150.  
  151.  
  152.  
  153. min(arg1, arg2)
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160. Applies to
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167. Math
  168.  
  169.  
  170.  
  171.  
  172.  
  173. Examples
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180. xxx Examples to be supplied.
  181.  
  182.  
  183.  
  184.  
  185.  
  186. See also
  187.  
  188.  
  189.  
  190.  
  191. max method
  192.  
  193.  
  194. ------------------------------------------------------------------------
  195.  
  196.  
  197.  
  198.  
  199.  
  200. open method
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208. For the window object, opens a new web browser window. xxx For the document object, description to be supplied.
  209.  
  210.  
  211.  
  212.  
  213.  
  214. Syntax
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221. The first form of the syntax is for the document object; the second form is for window.
  222. 1. document.open("MIME type")
  223. 2. window.open("URL", "windowName", ["windowFeatures"])
  224.  
  225.  
  226.  
  227.  
  228. URL specifies the URL to open in the new window.
  229.  
  230. windowName specifies a name for the window object being opened.
  231.  
  232. windowFeatures is a comma-separated list of any of the following options and values:
  233.  
  234.    toolbar[=yes|no]|[=1|0]
  235.    location[=yes|no]|[=1|0]
  236.    directories[=yes|no]|[=1|0]
  237.    status[=yes|no]|[=1|0]
  238.    menubar[=yes|no]|[=1|0]
  239.    scrollbars[=yes|no]|[=1|0]
  240.    resizable[=yes|no]|[=1|0]
  241.    copyhistory[=yes|no]|[=1|0]
  242.    width=pixels
  243.    height=pixels
  244.  
  245.  
  246.  
  247.  
  248. You may use any subset of these options.  Separate options with a comma.
  249. Do not put spaces between the options.
  250.  
  251.  
  252. pixels is a positive integer specifying the dimension in pixels.
  253.  
  254.  
  255.  
  256. NOTE:
  257. In event handlers, you must specify window.open() unless you want to call document.open()
  258. because of the scoping of static objects in JavaScript.
  259.  
  260.  
  261.  
  262.  
  263.  
  264. Description for window
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. The open method opens a new web browser window on the client, similar to choosing File|New Web Browser from the menu of the Navigator. The URL argument specifies the URL contained by the new window. If URL is an empty string, a new, empty window is created.
  272.  
  273.  
  274.  
  275. windowFeatures is an optional, comma-separated list of options for the new window. The boolean windowFeatures options are set to true if they are specified without values, or as yes or 1. For example, open("", "messageWindow", "toolbar") and open("", "messageWindow", "toolbar=1") both set the toolbar option to true. If windowName does not specify an existing window and you do not specify windowFeatures, all boolean windowFeatures are true by default.
  276.  
  277.  
  278.  
  279. Following is a description of the windowFeatures:
  280. toolbar creates the standard Navigator toolbar, with buttons such as "Back" and "Forward", if true
  281. location creates a Location entry field, if true
  282. directories creates the standard Navigator directory buttons, such as "What's New" and "What's Cool", if true
  283. status creates the status bar at the bottom of the window, if true
  284. menubar creates the menu at the top of the window, if true
  285. scrollbars creates horizontal and vertical scrollbars when the document grows larger than the window dimensions, if true
  286. resizable allows a user to resize the window, if true
  287. copyhistory gives the new window the same session history as the current window, if true
  288. width specifies the width of the window in pixels
  289. height specifies the height of the window in pixels
  290.  
  291.  
  292.  
  293.  
  294.  
  295. Description for document
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302. Description to be supplied.
  303.  
  304.  
  305.  
  306.  
  307.  
  308. Applies to
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315. document, window
  316.  
  317.  
  318.  
  319.  
  320.  
  321. Examples
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. In the following example, the windowOpener function opens a window and uses write methods to display a message:
  329. function windowOpener() {
  330.    msgWindow=open("","Display window","toolbar=no,directories=no,menubar=no");
  331.    msgWindow.document.write("<HEAD>ltTITLE>Message window<TITLE>lt/HEAD>);
  332.    msgWindow.document.write("<CENTER>ltBIG>ltB>Hello, world!<B>lt/BIG>lt/CENTER>);
  333. }
  334.  
  335.  
  336.  
  337.  
  338.  
  339. The following is an onClick event handler that opens a new client window displaying
  340. the content specified in the file sesame.html.
  341. It opens it with the specified option settings and
  342. names the corresponding window object newWin.
  343.  
  344.  
  345.  
  346.  
  347.  
  348. <FORM NAME="myform">
  349. <INPUT TYPE="button" NAME="Button1" VALUE="Open Sesame!" 
  350. onClick="window.open('sesame.html', 'newWin', 
  351. 'toolbar=no,directories=no,menubar=no,status=yes,width=300,height=300')">
  352. </form>
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362. Notice the use of single quotes (') inside the onClick event handler.
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369. See also
  370.  
  371.  
  372.  
  373.  
  374. close method
  375.  
  376.  
  377. ------------------------------------------------------------------------
  378.  
  379.  
  380.  
  381.  
  382.  
  383. parse method
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392. Syntax
  393.  
  394.  
  395.  
  396.  
  397. Date.parse(date string)
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404. Description
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412. The parse function takes a date string (such as "Dec 25, 1995"), and returns the number
  413. of milliseconds since January 1, 1970 00:00:00 (local time).
  414. This function is useful for setting date values based on string values,
  415. for example in conjunction with the setTime method.
  416.  
  417.  
  418.  
  419. Given a string representing a time, parse returns the time value. It accepts 
  420. the IETF standard date syntax: "Mon, 25 Dec 1995 13:30:00 GMT". 
  421. It understands the continental US time zone abbreviations, but for general use, 
  422. use a time zone offset, for example "Mon, 25 Dec 1995 13:30:00 GMT+0430" 
  423. (4 hours, 30 minutes west of the Greenwich meridian). If you do not specify a time zone,
  424. the local time zone is assumed. GMT and UTC are considered equivalent. 
  425.  
  426.  
  427.  
  428.  
  429. The parse function is a static method of Date.  That means that you always use it as
  430. Date.parse(), rather than as a method of a date object you created.
  431.  
  432.  
  433.  
  434.  
  435.  
  436. Applies to
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443. Date
  444.  
  445.  
  446.  
  447.  
  448.  
  449. Examples
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457. If IPOdate is an existing date object, then 
  458.  
  459. IPOdate.setTime(Date.parse("Aug 9, 1995"))
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467. See also
  468.  
  469.  
  470.  
  471.  
  472. UTC method
  473.  
  474.  
  475. ------------------------------------------------------------------------
  476.  
  477.  
  478.  
  479.  
  480.  
  481. pow method
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489. Returns arg1 to the arg2 power, i.e. arg1arg2.
  490.  
  491.  
  492.  
  493.  
  494.  
  495. Syntax
  496.  
  497.  
  498.  
  499.  
  500. pow(arg1, arg2)
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507. Applies to
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514. Math
  515.  
  516.  
  517.  
  518.  
  519.  
  520. Examples
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527. xxx Examples to be supplied.
  528.  
  529.  
  530.  
  531.  
  532.  
  533. See also
  534.  
  535.  
  536.  
  537.  
  538. sqrt method
  539.  
  540.  
  541. ------------------------------------------------------------------------
  542.  
  543.  
  544.  
  545.  
  546.  
  547. prompt method
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555. Displays an Prompt dialog box with a message and an input field
  556.  
  557.  
  558.  
  559.  
  560.  
  561. Syntax
  562.  
  563.  
  564.  
  565.  
  566. prompt(message, input default)
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573. Description
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580. Use the prompt method to display a dialog box that takes user input.
  581. The arguments, message and input default are
  582. JavaScript values to be displayed as the message and the default value in the input field, respectively.
  583.  
  584.  
  585.  
  586.  
  587.  
  588. Applies to
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595. window
  596.  
  597.  
  598.  
  599.  
  600.  
  601. Examples
  602.  
  603.  
  604.  
  605.  
  606.  
  607. prompt("Enter the number of doughnuts you want:", 12)
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615. See also
  616.  
  617.  
  618.  
  619.  
  620. alert, confirm methods
  621.  
  622.  
  623. ------------------------------------------------------------------------
  624.  
  625.  
  626.  
  627.  
  628.  
  629. random method
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637. Returns a pseudo-random number between zero and one. xxx NYI.
  638.  
  639.  
  640.  
  641.  
  642.  
  643. Syntax
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650. xxx To be supplied.
  651.  
  652.  
  653.  
  654.  
  655.  
  656. Applies to
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663. Math
  664.  
  665.  
  666.  
  667.  
  668.  
  669. Examples
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676. xxx Examples to be supplied.
  677.  
  678.  
  679. ------------------------------------------------------------------------
  680.  
  681.  
  682.  
  683.  
  684.  
  685. round method
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693. Returns its argument, rounded to the nearest integer. In other words, if its argument is n.5 or greater (where n is an integer), returns n+1, otherwise returns n.
  694.  
  695.  
  696.  
  697.  
  698.  
  699. Syntax
  700.  
  701.  
  702.  
  703.  
  704. round(arg)
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711. Applies to
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718. Math
  719.  
  720.  
  721.  
  722.  
  723.  
  724. Examples
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731. xxx Examples to be supplied.
  732.  
  733.  
  734. ------------------------------------------------------------------------
  735.  
  736.  
  737.  
  738.  
  739.  
  740. select method
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748. For password, text, and textArea, selects the input area of the object.
  749.  
  750.  
  751.  
  752.  
  753.  
  754. Syntax
  755.  
  756.  
  757.  
  758.  
  759. select()
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766. Description
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773. Use the select method to highlight the input area of a form element. You can use the select method with the focus method to highlight a field and position the cursor for a user response.
  774.  
  775.  
  776.  
  777.  
  778.  
  779. Applies to
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786. password, text, textArea
  787.  
  788.  
  789.  
  790.  
  791.  
  792. Examples
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799. In the following example, the checkPassword function confirms that a user has entered a valid password. If the password is not valid, the select method highlights the password field and focus method returns focus to it so the user can re-enter the password.
  800.  
  801. function checkPassword(userPass) {
  802.    if (badPassword) {
  803.       alert("Please enter your password again.")
  804.       userPass.focus()
  805.       userPass.select()
  806.    }
  807. }
  808.  
  809. This example assumes that the password is defined as:
  810. <INPUT TYPE=password NAME=userPass>/PRE>
  811.  
  812.  
  813.  
  814.  
  815.  
  816. See also
  817.  
  818.  
  819.  
  820.  
  821. blur, focus methods
  822.  
  823.  
  824. ------------------------------------------------------------------------
  825.  
  826.  
  827.  
  828.  
  829.  
  830. setDate method
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839. Syntax
  840.  
  841.  
  842.  
  843.  
  844. dateObj.setDate(day)
  845.  
  846.  
  847.  
  848. where dateObj is a date object.
  849.  
  850.  
  851.  
  852.  
  853.  
  854. Description
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. Sets the day of the month for the date object.
  863. The argument is an integer from 1 to 31.
  864.  
  865.  
  866.  
  867.  
  868.  
  869. Applies to
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876. Date
  877.  
  878.  
  879.  
  880.  
  881.  
  882. Examples
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890. The second statement below changes the day for theBigDay to the 24th of July from its original value.
  891.  
  892. theBigDay = new Date("July 27, 1962 23:30:00")
  893. Xmas95.setDate(24)
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902. See also
  903.  
  904.  
  905.  
  906.  
  907. xxx To be supplied.
  908.  
  909.  
  910. ------------------------------------------------------------------------
  911.  
  912.  
  913.  
  914.  
  915.  
  916. setHours method
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925. Syntax
  926.  
  927.  
  928.  
  929.  
  930. dateObj.setHours(hours 
  931.  
  932.  
  933.  
  934. where dateObj is a date object.
  935.  
  936.  
  937.  
  938.  
  939.  
  940. Description
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948. Sets the hours in the current time.
  949. The argument is an integer between 0 and 23.
  950.  
  951.  
  952.  
  953.  
  954.  
  955. Applies to
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962. Date
  963.  
  964.  
  965.  
  966.  
  967.  
  968. Examples
  969.  
  970.  
  971.  
  972.  
  973.  
  974. theBigDay.setHours(7)
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982. See also
  983.  
  984.  
  985.  
  986.  
  987. xxx To be supplied.
  988.  
  989.  
  990. ------------------------------------------------------------------------
  991.  
  992.  
  993.  
  994.  
  995.